using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace HamcoWcs.Entitys.BaseConfigs
{
    public class AlarmExplanationConfig : IEntityTypeConfiguration<AlarmExplanation>
    {
        public void Configure(EntityTypeBuilder<AlarmExplanation> builder)
        {
            builder.HasComment("故障说明配置表");
            builder.Property(x => x.ErrorType).IsRequired().HasMaxLength(30).HasComment("报警类型");
            builder.Property(x => x.Module).IsRequired().HasMaxLength(30).HasComment("模块");
            builder.Property(x => x.Code).IsRequired().HasMaxLength(30).HasComment("错误代码");
            builder.Property(x => x.Level).IsRequired().HasDefaultValue(1).HasComment("等级");
            builder.Property(x => x.AlarmName).IsRequired().HasMaxLength(50).HasComment("故障名");
            builder.Property(x => x.Summary).IsRequired(false).HasDefaultValue("").HasMaxLength(255).HasComment("描述");
            builder.Property(x => x.Suggestion).IsRequired(false).HasDefaultValue("").HasMaxLength(255).HasComment("建议");
        }
    }
}